package com.calm.editor.api;

import java.io.Serializable;
import java.util.List;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

public interface BaseService<T, I extends Serializable> {
	static interface Query<T> {
		void query(CriteriaBuilder builder, CriteriaQuery<T> query, Root<T> from);
	}

	T getById(I id);

	public void update(T t);

	public void save(T t);

	public List<T> query(Query<T> q);
}
